         
<template>
  <!-- 出库单详情页面 -->
  <div>
    <!--信息单 -->
    <div>
      <el-row>
        <el-menu
          class="el-menu-demo"
          mode="horizontal"
        >
          <el-menu-item index="1"
                        style="font-size : 20px;font : blod;color:black">出库单详情页</el-menu-item>
          <span class="but">
            <el-button icon="el-icon-edit-outline"
                       :plain="true"
                       @click="print()">打印</el-button>
            <el-button icon="el-icon-edit-outline"
                       :plain="true"
                       @click="audit()">审核</el-button>
            <el-button icon="el-icon-edit-outline"
                       :plain="true"
                       @click="recheck()">反审</el-button>
            <el-button icon="el-icon-edit-outline"
                       :plain="true"
                       @click="complete()">完成</el-button>
            <el-button icon="el-icon-edit-outline"
                       :plain="true"
                       @click="editor()">编辑</el-button>                                            
            <el-button type="primary"
                       icon="el-icon-document"
                       :plain="true"
                       @click="backout()">撤销</el-button>
              <router-link :to="{path:'/StockOutManager'}">         
            <el-button type="primary" icon="el-icon-top-left"
                       :plain="true"
                       @click="goback()">返回</el-button>    
              </router-link>                
          </span>

          <template>

          </template>

        </el-menu>
        <span>
          <font style="font-size : 15px;margin-left:20px">基本信息</font>
        </span>
        </el-row><br>

        <el-form :inline="true"
                v-loading="loading"
               label-width="90px"
               :model="formdata">
        <el-row>
          <el-col :span="7">
            <el-form-item label="表单类型：" prop="ioOrderType">
              <!-- {{formdata.ioOrderType}} -->
              <p>{{formdata.ioOrderType}}</p>
            </el-form-item>
          </el-col>
  
          <el-col :span="7"
                  :offset="1">
            <el-form-item label="品类：" prop="category">
              {{formdata.category}}
            </el-form-item>
          </el-col>

          <el-col :span="7"
                  :offset="1">
            <el-form-item label="仓库：" prop="warehouse">
              {{formdata.warehouse}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="7">
            <el-form-item label="制单人：" prop="voucherP">
             {{formdata.voucherP}}
            </el-form-item>
          </el-col>

          <el-col :span="7"
                  :offset="1">
            <el-form-item label="状态：" prop="status">
              {{formdata.status}}
            </el-form-item>
          </el-col>

          <el-col :span="7"
                  :offset="1">
            <el-form-item label="审核时间：" prop="auditDate">
             {{formdata.auditDate}}
            
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="7">
            <el-form-item label="制单时间：" prop="voucherDate">
              {{formdata.voucherDate}}
            </el-form-item>
          </el-col>

          <el-col :span="7"
                  :offset="1">
            <el-form-item label="审核人" prop="auditor">
              {{formdata.auditor}}
            </el-form-item>
          </el-col>

          <el-col :span="7"
                  :offset="1">
            <el-form-item label="单号：" prop="ioOrderNo">
              {{formdata.ioOrderNo}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-menu
            class="el-menu-demo"
            mode="horizontal"
          >
            <el-menu-item index="1"
                          style="font-size : 15px;color:black">产品信息</el-menu-item>
 
          </el-menu>

        </el-row>

      </el-form>
      
      
    </div>

    <div>

      <!-- 产品信息表格 -->
      <el-table :data="tableData"
                style="width: 100%">
        <el-table-column label="序号"
                       align="center"
                       width="50">
        <template slot-scope="scope">
          <span>
            {{ scope.$index + 1 }}
          </span>
        </template>
      </el-table-column>

      <el-table-column prop="ioOrderNo"
                       align="center"
                       label="单号"
                       width="180">
      </el-table-column>

      <el-table-column prop="customer"
                       align="center"
                       label="客户"
                       width="100">
      </el-table-column>
      <el-table-column prop="ioOrderType"
                       align="center"
                       label="类型"
                       width="100">
      </el-table-column>
      <el-table-column prop="area"
                       align="center"
                       label="区域"
                       width="80">
      </el-table-column>
      <el-table-column prop="status"
                       align="center"
                       label="状态"
                       width="80">
       <template slot-scope="scope">
          <span v-if="scope.row.status == 1 ">
            未开始
          </span>
          <span v-if="scope.row.status == 2 ">
            待审批
          </span>
          <span v-if="scope.row.status == 3 ">
            失败
          </span>
          <span v-if="scope.row.status == 4 ">
            成功
          </span>
          
        </template>

      </el-table-column>                
      
      <el-table-column prop="condition"
                       align="center"
                       label="成色"
                       width="80">
      </el-table-column>
      <el-table-column prop="weight"
                       align="center"
                       label="重量(g)"
                       width="80">
      </el-table-column>
      <el-table-column prop="amount"
                       align="center"
                       label="数量"
                       width="100">
      </el-table-column>
      <el-table-column prop="perGram"
                       align="center"
                       label="克工费"
                       width="170">
      </el-table-column>
        
        
      </el-table>
      <!-- 分页 -->
      <el-pagination style="float:right"
                     @size-change="handleSizeChange"
                     @current-change="handleCurrentChange"
                     :current-page="1"
                     :page-sizes="[10, 20, 30]"
                     :page-size="10"
                     layout="total, sizes, prev, pager, next, jumper"
                     :total="80">
      </el-pagination>
    </div>
  </div>
</template>

<script>
import {findFormdata,findTableData} from '@/api/warehouse/StockOutManager/StockOutDetail'
export default {
  data() {
    return {
     //展示上半部分数据
      formdata: {
          ioOrderType:"",
          category:"",
          warehouse:"",
          voucherP:"",
          status:"",
          auditDate:"",
          voucherDate:"",
          auditor:"",
          ioOrderNo:"",
        },
      // formdata:[],
      //产品信息展示
      tableData: [],
      // 添加商品信息
      dialogTableVisible: false,
      dialogFormVisible: false,
      gridData: [],
      multipleSelection: [],
      //分页
      pageNum:1,
      pageSize:10,
      total:null,
    }
  },
  //方法区
  methods: {
    //分页
    //分页
    handleSizeChange(val) {
      this.pageSize = val
      this.open()
    },
    handleCurrentChange(val) {
      this.pageNum = val
      this.open()
    },


    
   
getList(){
        let IoWarehouse = {};
      IoWarehouse.ioOrderNo=this.$route.params.ioOrderNo;
      
      console.log(IoWarehouse);
    //查找上半部分信息
    findFormdata(this.pageNum,this.pageSize,IoWarehouse).then(res => {
        //this.$modal.msgSuccess("查找成功");

        console.log(res)
         this.formdata = res.data.list[0]
         this.total = res.data.total
        this.loading = false;
      });
    let  StockInDetailsDto ={};
    StockInDetailsDto.ioOrderNo=this.$route.params.ioOrderNo;
    console.log(StockInDetailsDto);

    //查找下半部分信息
    findTableData(this.pageNum,this.pageSize,StockInDetailsDto).then(res => {
        //this.$modal.msgSuccess("查找成功");

        console.log(res)
         this.tableData = res.data.list
         this.total = res.data.total
        this.loading = false;
      });
    }
  },

  created() {
   this.getList()
  },
}
</script>

<style scoped>
.but {
  float: right;
}
</style>
